<html>
    <head>
        <title>newspower</title>
    </head>
    <body>
        <br/>
        <br/>
        <p><b><font style="font-size:20px">NEWSPOWER接口说明：</font></b></p>
        <p/>
        <p><b>增加分析任务:</b></p>
        <p>/newspower/task?udid={udid}&url=encode({mp4_url})&callback=encode({callback})</p>
        <p>udid是自定义的编号,在回调时会随结果返回,如果不需要此值,可填任意值,但最大不能超过50个字符;</p>
        <p>mp4_url是能够访问的mp4的地址, 可通过该地址进行视频的下载处理, 该内容一定是经过encode编码的内容,否则会出问题;</p>
        <p>callback是回调的地址, 处理完成后，会通过该地址回调处理的结果，该内容也需要进行encode编码;</p>
        <p>请求返回的结果json格式,例子如下:</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;{ tid = {tid},udid = {udid}, mp4 = {mp4_url}, callback = {callback},taskid = {taskid},info = {result}</p>

        <p><b>查询分析任务:</b></p> 
        <p>/newspower/query?tid={tid}</p>
        <p>tid是任务建立后，返回的系统任务编号</p>
        <p>返回是json的结果,例子如下:</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;{"cmd":"callback","info":"OK","result":"end"}</p>
        <p>如果正常结束，则result是end状态，如果未正常结束，则为over, 可以在info中查看问题原因;</p>
        <p><b>任务回调:</b></p> 
        <p>通过post方法，返回是json格式的结果,例子如下:</p>
        <p>&nbsp;&nbsp;&nbsp;&nbsp;{"cmd":"callback","info":"OK","result":"end"}</p>

        <p><b>回调样例:</b></p> 
        <p>如果系统正常处理完成后，会返回json格式的结果，具体的格式内容如下:</p>
        <p>{</p>
        <p>"tid":"absscdf-112lsd-aasdf-1wwe-aaaxs", </p>
        <p>"cid":"absscdf-112lsd-vsddf-aasd-wer12", </p>
        <p>"callback":"http://mycb.yunshicloud.com",</p>
        <p>"udid":"abcd-sdfdf-ssdfg-1234-aadf",</p>
        <p>"time":"2022-04-28 13:10:23.234", </p>
        <p>"result":</p>
        <p>[{"seq": "061651", "pts": "000221940180", "category": "boundary", "property": "key"}, </p>
        <p>{"seq": "074401", "pts": "000267840180", "category": "normal", "property": "key"}, </p>
        <p>{"seq": "066501", "pts": "000239400180", "category": "normal", "property": "key"}, </p>
        <p>{"seq": "014451", "pts": "000052020090", "category": "normal", "property": "key"}, </p>
        <p>{"seq": "068101", "pts": "000245160180", "category": "normal", "property": "key"}, </p>
        <p>{"seq": "064651", "pts": "000232740180", "category": "boundary", "property": "point"}, </p>
        <p>{"seq": "065051", "pts": "000234180180", "category": "boundary", "property": "point"}, </p>
        <p>{"seq": "024301", "pts": "000087480090", "category": "boundary", "property": "key"}, </p>
        <p>{"seq": "071851", "pts": "000258660270", "category": "boundary", "property": "point"}, </p>
        <p>{"seq": "064451", "pts": "000232020180", "category": "boundary", "property": "key"}, </p>
        <p>{"seq": "082251", "pts": "000296100180", "category": "normal", "property": "key"}]</p>
        <p>}</p>
        <p>result字段说明：</p>
        <p>seq:该图片从第一帧开始到该帧的序号；</p>
        <p>pts:该帧图片的pts值，如果计算时间可能需要与第一帧的pts来结合着处理;</p>
        <p>category:该帧图片的分类，boundary是转场的边界，anchor是有主持人出镜，normal就是一般信息图片</p>
        <p>property:该帧图片的确认归属，point是认为该帧图片是关键点，key认为该帧图片只是普通的关键帧</p>
       
    </body>
</html>